package com.eight.controller;

import com.eight.service.ChatService;
import com.eight.vo.ComResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description: TODO
 * @Author: Van.Planifolia
 * @CreateTime: 2023-03-02  21:12
 * @Version: 1.0
 */
@RestController
public class ChatController {
    @Autowired
    private ChatService chatService;

    /**
     * 查询俩个人的聊天记录
     * @param from 来自
     * @param to 发送给
     * @return 结果
     */
    @GetMapping("/chat/getChatRecords/{from}/{to}")
    public ComResult getChatRecords(@PathVariable String from, @PathVariable String to){
        return chatService.searchRecords(from,to);
    }
}
